{extend name="common/index" /}

{block name="css"}
<link type="text/css" rel="stylesheet" href="../../static/common/jedate-6.5.0/skin/jedate.css">
<script type="text/javascript" src="../../static/common/jedate-6.5.0/src/jedate.js"></script>
<style>
    /*修改bootstrap表格边框颜色*/
    .table-bordered th,
    .table-bordered td {
        border: 1px solid #bbb !important;
        text-align:center;
        font-size:16px;
    }
</style>
{/block}

{block name="content-wrapper"}
<section class="content-header">
    <h1>
        <a href="{:url('index/index/full_transaction_data')}" target="_blank">交易数据</a>
        <small>transaction data</small>
    </h1>
    <div style="margin-top: 10px;">
            <input id="date" name="date" type="text" placeholder="请选择日期"
                   style="height:30px;width:100px;text-align:center;vertical-align:top;" readonly>
            <input class="submit" type="submit" style="height:30px;width:50px;background:#169BD5;color:#fff;border:0;border-radius: 6px;text-align:center;" value="搜索">
    </div>
</section>
<section class="content container-fluid">
    <table class="table table-hover table-bordered">
        <tr>
            <td class="col-md-3">会员用户</td>
            <td class="col-md-3">订单商家</td>
            <td class="col-md-2">订单金额</td>
            <td class="col-md-2">下单时间</td>
            <td class="col-md-2">付款时间</td>
        </tr>
        {volist name='res' id='val'}
        <tr>
            <td>{$val['user']}</td>
            <td>
                <?php
					echo '****'.str_replace(mb_substr($val['store_name'],0,2,'utf-8'),'',$val['store_name']);
				?>
            </td>
            <td>{$val['order_price']}</td>
            <td>{$val['order_time']}</td>
            <td>{$val['pay_time']}</td>
        </tr>
        {/volist}
    </table>
    <div>
        <span style="float:left;margin-top:20px;font-size: 16px;">
            本月总计交易笔数：{$count} 笔&nbsp;&nbsp;&nbsp;&nbsp;本月总计交易金额：{$this_month_order_price} 元
            <div style="color: blue;">
                累计交易笔数：{$all_order_num} 笔&nbsp;&nbsp;&nbsp;&nbsp;累计交易金额：{$all_order_price} 元
            </div>
        </span>
        <span style="float:right;">
            {$page}
        </span>
    </div>
</section>
{/block}

{block name="introduce-js"}
<script type="text/javascript">
    $(document).ready(function (e) {
        //写入方法
        $("#date").val("<?php echo $date;?>");
    });

    $(function () {
        jeDate("#date", {
            format: "YYYY-MM",
            isTime: false,
            isClear: false,
            minDate: "2016-01",
            maxDate: "2018-08"
        })
    });

    $('.submit').click(function () {
        var date = $('input[name=date]').val();
        window.location.href = "{:url('index/index/transaction_data')}?date=" + date;
    });
</script>
{/block}
